package gui;

import java.awt.Color;
import java.awt.GridBagLayout;

import javax.swing.ImageIcon;
import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.io.File;
import java.util.HashMap;

import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import code.Language;
import code.Settings;

public class ExistingKey extends JPanel {

	private static final long serialVersionUID = 1L;
	private JLabel jLabel = null;
	private JLabel jLabel1 = null;
	private JScrollPane jScrollPane = null;
	private JTable jTable = null;
	private JLabel jLabel2 = null;
	private JLabel jLabel3 = null;
	private HashMap labels;
	private Settings s;
	
	/**
	 * This is the default constructor
	 */
	public ExistingKey() {
		super();
		Language l = new Language();
		s= new Settings();
		labels = l.changeLanguage((String) s.global.get("language"), "ExistingKey", (String) s.global.get("installPath"));
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		jLabel3 = new JLabel();
		jLabel3.setBounds(new Rectangle(666, 87, 45, 16));
		jLabel3.setText((String) labels.get("jLabel3"));
		jLabel2 = new JLabel(new ImageIcon((String) s.global.get("installPath") + File.separator + "images/en/approve.gif"));
		jLabel2.setBounds(new Rectangle(582, 60, 78, 90));
		jLabel1 = new JLabel(new ImageIcon((String) s.global.get("installPath") + File.separator + "images/en/keylist.gif"));
		jLabel1.setBounds(new Rectangle(30, 19, 192, 173));
		jLabel = new JLabel();
		jLabel.setBounds(new Rectangle(256, 19, 303, 16));
		jLabel.setText((String) labels.get("jLabel"));
		this.setSize(779, 434);
		this.setLayout(null);
		this.add(jLabel, null);
		this.add(jLabel1, null);
		this.setBackground(Color.WHITE);
		this.add(getJScrollPane(), null);
		this.add(jLabel2, null);
		this.add(jLabel3, null);
	}

	/**
	 * This method initializes jScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setBounds(new Rectangle(255, 60, 297, 286));
			jScrollPane.setViewportView(getJTable());
		}
		return jScrollPane;
	}

	/**
	 * This method initializes jTable	
	 * 	
	 * @return javax.swing.JTable	
	 */
	private JTable getJTable() {
		if (jTable == null) {
			
			Object rowData[][] = { { "Row1-Column1", "Row1-Column2" },
					{ "Row2-Column1", "Row2-Column2" } };
			Object columnNames[] = { (String) labels.get("tab1"),  (String) labels.get("tab2") };
			
			jTable = new JTable(rowData, columnNames);
		}
		return jTable;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
